<template>
  <!-- 促销单品 -->
  <ul>
    <li class="iphone" v-for="item in benefit" :key="item.id">
      <div class="phone">
        <router-link :to="`ProductDetails/${item.id}`">
          <img :src="item.image" />
        </router-link>
      </div>

      <div class="phone1">
        <div class="box1">
          <span class="wrap">{{ item.store_name }}</span>
        </div>
        <div class="box2">
          <i>促销价￥{{ item.price }}</i>
        </div>
        <div class="box3">
          <span>日常价：￥{{ item.ot_price }}</span>
        </div>
        <div class="box4">
          <span class="che" size="15px"
            >仅剩:{{ item.stock }}{{ item.unit_name }}</span
          >
        </div>
      </div>
    </li>
  </ul>
</template>

<script>
export default {
  props: ["benefit"],
};
</script>

<style lang="less" scoped>
.iphone {
  border-bottom: 1px solid #f5f5f5;
  position: relative;
  width: 95vw;
  height: 117px;
  display: flex;
  align-items: center;
  .phone {
    padding: 15px;
    width: 90px;
    height: 90px;
    img {
      width: 100%;
      height: 100%;
    }
  }
  .phone1 {
    flex: 1;
    padding: 15px 15px 15px 0px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    .box1 {
      vertical-align: top;
      text-overflow: ellipsis;
      white-space: nowrap;
      overflow: hidden;
      .wrap {
        font-size: 15px;
      }
    }
    .box2 {
      margin-top: 15px;
      color: white !important ;

      //   font-weight: bold;
      i {
        display: inline-block;
        font-size: 12px;
        background-color: #ff3e1e;
        border: 1px solid #ff6248;
        border-top-left-radius: 12px;
        border-bottom-right-radius: 12px;
        line-height: 22px;
        padding: 0px 8px;
      }
    }
    .box3 {
      color: #ccc;
      margin-top: 5px;
      font-size: 12px;
      span {
        text-decoration: line-through;
      }
    }
  }
  .box4 {
    width: 20px;
    height: 20px;
    position: absolute;
    right: 15px;
    bottom: 19px;
    border-radius: 50%;
    .che {
      color: #999;
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      font-size: 12px;
    }
  }
}
</style>